<template>
  <div class="el-showimg">
    <div>
      <img src="" alt="图片" srcset="">
    </div>
    <div>
      <img src="" alt="视频" srcset="">
      <video src="">你的浏览器不支持视频</video>
    </div>
  </div>
</template>
<script>
export default {
  data () {
   return {
     sourceUrl: [
       'http://ddwl.file.qiankunhaoche.com/d50f9123-deb9-c703-14dd-df45a2816bc5.png',
       'https://sjwl-qnc.oss-cn-beijing.aliyuncs.com/1597387382035u=19064698564113625838&fm=26&gp=0.jpg.png',
       'http://192.168.0.104:4000/images/002.mp4'
     ], //媒体资源
   }
  },
  mounted(){},
  methods:{
    //判断是否图片
    isImage(type) {
      return [
        ".jpeg",
        ".png",
        ".jpg",
        ".gif",
        ".bmp"
      ].includes(type);
    },
    //判断是否视频
    isVideo(type) {
      return [
        "video/mp4",
        "video/ogg",
        "video/flv",
        "video/avi",
        "video/wmv",
        "video/rmvb",
        "video/mov",
        "video/quicktime"
      ].includes(type);
    }
  },
}
</script>
<style lang='less' scoped>
.el-showimg {
  display: flex;
}
</style>
